// Filename: views/projects/list
define([
    'jquery',
    'underscore',
    'backbone',
    'module/category/models/CategoryModel',
    'module/category/models/CategoryCollection',
    'text!module/category/templates/list.html'

], function($, _, Backbone, CategoryModel, CategoryCollection, list) {
    var BookListView = Backbone.View.extend({
        el: $("#main-list"),
        events: {"click #delete": "delete"},
        render: function() {

            var data = {
                list: this.collection.models,
                _: _
            };

            var compiledTemplate = _.template(list, data);
            $("#main-list").html(compiledTemplate);

            $("#main-pagination").html('<ul />');
            var len = this.options.count;
            var pageCount = Math.ceil(len / 8);

            for (var i = 0; i < pageCount; i++) {
                $('ul', $("#main-pagination")).append("<li><span id=\"pag\" index=\"" + (i + 1)+"\" >" + (i + 1)+"<span/></li>");
            }
        },
        delete: function() {

        }
    });
    return BookListView;
});
